import { http } from '@/utils/http/axios';

/**
 * 获取用户信息
 */
export function getUserInfo() {
  return http.request({
    url: '/admin/user/info',
    method: 'GET',
  });
}

/**
 * 登录
 */
export function login(data) {
  return http.request({
    url: '/admin/login',
    method: 'POST',
    data,
  });
}

/**
 * 用户修改密码
 */
export function resetPassword(params) {
  return http.request({
    url: '/api/site_user/reset_password',
    method: 'POST',
    params,
  });
}

/**
 * 用户登出
 */
export function logout(params) {
  return http.request({
    url: '/login/logout',
    method: 'POST',
    params,
  });
}

/**
 * 获取配置
 */
export function matchSite(params) {
  return http.request({
    url: '/api/match_site',
    method: 'POST',
    params,
  });
}

/**
 * 获取配置
 */
export function siteConfigInfo(params) {
  return http.request({
    url: '/api/site_config/info',
    method: 'get',
    params,
  });
}

/**
 * 总后台跳转至服务商后台
 * 1:读写 2:只读(默认传2)
 */
export function siteLocationSite(data) {
  return http.request({
    url: '/api/site/location_site',
    method: 'POST',
    data,
  });
}
